import instance from '@/until/request'

export const swiper = () => {
  return instance.get('/home/swiper')
}

export const rentHome = () => {
  return instance.get('/home/groups')
}

export const message = () => {
  return instance.get('/home/news')
}

export const login = data => {
  return instance.post('/user/registered', data)
}

export const register = (data) => {
  return instance.post('/user/login', data)
}

export const citylist = (num) => {
  return instance.get('/area/city', { params: { level: num } })
}

export const user = () => {
  return instance.get('/user')
}

export const house = (id) => {
  return instance.get('/houses', {
    params: {
      cityId: id || 'AREA|dbf46d32-7e76-1196'
    }
  })
}

// 区域
export const condition = (value) => {
  return instance.get('/houses/condition', {
    params: {
      id: value || 'AREA|dbf46d32-7e76-1196'
    }
  })
}
